#include  <cstdio>
#include  <iostream>
#include  <string>
using namespace std;

int main(int argc, char *argv[])
{
	string a[15];
	int n,counter = 0;
	while( scanf("%d",&n) && n!=0 )
	{
		int i = 0, j = n-1;
		for( int k = 0; k < n ; ++k )
		{
			if(k%2 == 0)
				cin >> a[i++];
			else
				cin >> a[j--];
		}
		printf("SET %d\n",++counter);
		for( int i = 0; i < n ; ++i )
			cout << a[i] << endl;
	}
}
